package com.sikaryofficial.backend.config;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * @author : wuweihong
 * @desc : 积分规则配置
 * @date : 2024-12-09
 */

@Getter
@Setter
@Configuration
@RefreshScope
@ConfigurationProperties(prefix = "hismk.backend.pointsrule")
@Slf4j
public class PointsRuleConfig {
	/**
	 *  禁用的积分任务
	 */
	private List<String> disabledRuleList;
	/**
	 * 标题带特定标签的积分任务
	 */
	private List<String> labeledRuleList;

	/**
	 * 官方发帖人账号列表配置
	 */
	private List<Long> officialUserIds;

	public boolean isOfficialUser(Long userId) {
		if (officialUserIds == null) {
			return false;
		}
		return officialUserIds.contains(userId);
	}

}
